package com.sx.art2.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.sx.art2.beans.RukuInfo;
import com.sx.art2.service.RukuInfoService;
     @Controller
public class RukuInfoController {
     @Autowired
     RukuInfoService rukuInfoService;
     @RequestMapping("/listrukuInfo")
	 public ModelAndView list() {
		ModelAndView mv = new ModelAndView();
		List<RukuInfo> list =rukuInfoService.list();
		mv.addObject("list", list);
		mv.setViewName("admin/rukulist");
			return mv;	   
	   }
 	@RequestMapping("/updaterukuInfo")
 	@ResponseBody
 	public String update(RukuInfo rukuInfo) {
 	   String date="success";
 		rukuInfoService.update(rukuInfo);
 		return date;
 		
 	}
	@RequestMapping("/deleterukuInfo")
	@ResponseBody
	public String deleteStock(int rukuId) {
		String date="success";
		rukuInfoService.delete(rukuId);
		return date;
	}
	@RequestMapping("/selectByartAdddate1")
	 public ModelAndView list2(String artAdddate) {
		ModelAndView mv = new ModelAndView();
		List<RukuInfo> list2=rukuInfoService.list2(artAdddate);
		mv.addObject("list2", list2);
		mv.setViewName("admin/rukulist1");
			return mv;	   
	   }
	
	
}
